package com.jwsoft.manager.core.gateway.controller.common;

import com.bifang.engine.assistant.core.domain.AppResponse;
import com.bifang.engine.cache.redis.RedisHelper;
import com.bifang.engine.protect.core.annotation.NoSignCrypto;
import com.jwsoft.manager.common.constant.EduCache;
import com.jwsoft.manager.common.vo.common.AreaControlVO;
import com.jwsoft.manager.core.integration.BatchCallSjgxIntegration;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "/doc/api")
@Tag(name = "批量大数据管理", description = "批量大数据管理")
public class BatchCommonController {
    @Autowired
    private RedisHelper redisHelper;
    @Autowired
    private BatchCallSjgxIntegration batchCallSjgxIntegration;
    @PostMapping(value = "/batchCall0001")
    @Operation(summary = "批量获取房产", description = "批量获取房产")
    public AppResponse saveBatchHouseInterfaceFree(@RequestBody AreaControlVO vo){
        String redisKey= EduCache.EDU_BATCH_handle+"getFc";
        redisHelper.del(redisKey);
        batchCallSjgxIntegration.saveBatchHouseInterfaceFree(vo);
        return AppResponse.success();
    }
    @PostMapping(value = "/batchCall0002")
    @Operation(summary = "批量获取户籍", description = "批量获取户籍")
    public AppResponse saveBatchHouseholdInterfaceFree(@RequestBody AreaControlVO vo){
        String redisKey= EduCache.EDU_BATCH_handle+"getHj";
        redisHelper.del(redisKey);
        batchCallSjgxIntegration.saveBatchHouseholdInterfaceFree(vo);
        return AppResponse.success();
    }
    @PostMapping(value = "/batchCall0003")
    @Operation(summary = "批量获取社保", description = "批量获取社保")
    public AppResponse saveBatchCbInterfaceFree(@RequestBody AreaControlVO vo){
        String redisKey= EduCache.EDU_BATCH_handle+"getSb";
        redisHelper.del(redisKey);
        batchCallSjgxIntegration.saveBatchCbInterfaceFree(vo);
        return AppResponse.success();
    }

    @PostMapping(value = "/batchCall0004")
    @Operation(summary = "批量获取居住证", description = "批量获取居住证")
    public AppResponse saveBatchJzzInterfaceFree(@RequestBody AreaControlVO vo){
        String redisKey= EduCache.EDU_BATCH_handle+"getJzz";
        redisHelper.del(redisKey);
        batchCallSjgxIntegration.saveBatchJzzInterfaceFree(vo);
        return AppResponse.success();
    }

    @PostMapping(value = "/batchCall0005")
    @Operation(summary = "批量获取网签", description = "批量获取网签")
    public AppResponse saveBatchNetSignInterfaceFree(@RequestBody AreaControlVO vo){
        String redisKey= EduCache.EDU_BATCH_handle+"getWq";
        redisHelper.del(redisKey);
        batchCallSjgxIntegration.saveBatchNetSignInterfaceFree(vo);
        return AppResponse.success();
    }
    @PostMapping(value = "/batchCall0006")
    @Operation(summary = "批量获取企业", description = "批量获取企业")
    public AppResponse saveBatchQyInterfaceFree(@RequestBody AreaControlVO vo){
        String redisKey= EduCache.EDU_BATCH_handle+"getQy";
        redisHelper.del(redisKey);
        batchCallSjgxIntegration.saveBatchQyInterfaceFree(vo);
        return AppResponse.success();
    }
    @PostMapping(value = "/batchCall0007")
    @Operation(summary = "批量比对家庭关系", description = "批量比对家庭关系")
    public AppResponse getBatchFamInfoComparison(@RequestBody AreaControlVO vo){
        String redisKey= EduCache.EDU_BATCH_handle+"getFamInfo";
        redisHelper.del(redisKey);
        batchCallSjgxIntegration.getBatchFamInfoComparison(vo);
        return AppResponse.success();
    }

    @PostMapping(value = "/batchCall0008")
    @Operation(summary = "批量获取缴费月数", description = "批量获取缴费月数")
    public AppResponse saveBatchCbLjjfysInterfaceFree(@RequestBody AreaControlVO vo){
        String redisKey = EduCache.EDU_BATCH_handle + "getCbljjf";
        redisHelper.del(redisKey);
        batchCallSjgxIntegration.saveBatchCbLjjfysInterfaceFree(vo);
        return AppResponse.success();
    }
    @PostMapping(value = "/batchCallSjgx0013")
    @Operation(summary = "大数据比对房户一致", description = "大数据比对房户一致")
    public AppResponse fhyzTask(@RequestBody AreaControlVO vo){
        String redisKey = EduCache.EDU_BATCH_handle + "getFcHjYz";
        redisHelper.del(redisKey);
        batchCallSjgxIntegration.fhyzTask(vo);
        return AppResponse.success();
    }

}
